Once a client has established a connection to the server, the only commands it may initially perform are those which allow it to register a new account or login to an existing account – any other command should be met with a failure response. Once the client has logged in, either by using an existing account or by creating a new one, it may perform any action or request on the server. At the same time, the server may send actions or requests to the client itself, which the client must be prepared to process and respond to, including the heartbeat as explained in the above section. A particular user should only be able to login once, after which they must either logout or wait for the server to logout the account itself if it fails to send a heartbeat.

\begin{figure}[ht!]
	\centering
	\includegraphics[scale=0.5]{images/serverinteraction.png}
    \caption{Interaction between client and server}
    \end{figure}

Figure 4.2 shows the interaction between the client and server components. After the connection is established, the client can send the server actions, requests and responses, while the server can send the client actions and responses. This is a continuous cycle until the client disconnects.